This is a demo of how to send commands to RoadRunner from Java.
This demo was made by Vicne (mp3car.com user) -- Greets from Belgium.

Prerequisite : a Java Runtime Engine (or a full JDK) should be installed. 
(Tested with JDK v1.5 (Java 5) but should work with previous versions)

1) How to test
- Make sure RoadRunner is running, and Winamp is playing (not the last track of the playlist)
- Double click demo.bat
=> Winamp should jump to next track


2) How to use the library : 
- rrinterface.dll must be in the path
- RRInterface.jar must be in the classpath
- call the code as follows (see src\RRInterfaceDemo.java) :
        RRInterface wi = new RRInterface();
        wi.sendRRCommand("NEXT");
        
3) How to compile the library :
This involves JNI which is not a simple technology. You'll need both a Java environment (JDK) and a C environment (e.g. MinGW)
In short, the steps are :
- compile the RRInterface.java class which contains declaration of native methods
- extract a C header file from the compiled RRInterface.class. Your command should look like :
%JAVA_HOME%\bin\javah -classpath <path where you compiled RRInterface.java> -o rrinterface.h org.tlcdcemu.plugin.roadrunner.RRInterface
- compile the DLL from the just generated header and included rrinterface.c file. Your command should look like :
%MINGW_HOME%\bin\gcc -Wall -mno-cygwin -shared -Wl,--add-stdcall-alias -I %JAVA_HOME%\include -I %JAVA_HOME%\include\win32 -o rrinterface.dll rrinterface.c

